home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: Mailbox/MIME Entity
(archive/mbox).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| Newsgroup Content (archive/news)
| magic
| Supported |
100%
| dexvert
| Mailbox/MIME Entity (archive/mbox)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| news text
| default
| |
99%
| file
| C source text
| default
| |
98%
| file
| C source, ASCII text
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| dexmagic
| PrintFox/Pagefox WEAK
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/950 MIME Email (1.0)
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
| |
100%
| xdgMime
| message/news
| default
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 50 61 74 68 3a 20 6e 65 | 77 73 32 2e 63 6f 6d 70 |Path: ne|ws2.comp|
|00000010| 75 6c 69 6e 6b 2e 63 6f | 6d 21 6e 6f 74 2d 66 6f |ulink.co|m!not-fo|
|00000020| 72 2d 6d 61 69 6c 0a 4e | 65 77 73 67 72 6f 75 70 |r-mail.N|ewsgroup|
|00000030| 73 3a 20 63 6f 6d 70 2e | 6c 61 6e 67 2e 63 0a 46 |s: comp.|lang.c.F|
|00000040| 72 6f 6d 3a 20 68 6f 64 | 67 65 73 40 69 64 69 72 |rom: hod|ges@idir|
|00000050| 65 63 74 2e 63 6f 6d 20 | 28 48 6f 64 67 65 73 40 |ect.com |(Hodges@|
|00000060| 69 64 69 72 65 63 74 2e | 63 6f 6d 29 0a 53 75 62 |idirect.|com).Sub|
|00000070| 6a 65 63 74 3a 20 4c 6f | 77 20 6c 65 76 65 6c 20 |ject: Lo|w level |
|00000080| 72 65 61 64 69 6e 67 20 | 61 6e 64 20 77 72 69 74 |reading |and writ|
|00000090| 69 6e 67 0a 43 6f 6e 74 | 65 6e 74 2d 54 79 70 65 |ing.Cont|ent-Type|
|000000a0| 3a 20 54 65 78 74 2f 50 | 6c 61 69 6e 3b 20 63 68 |: Text/P|lain; ch|
|000000b0| 61 72 73 65 74 3d 55 53 | 2d 41 53 43 49 49 0a 4d |arset=US|-ASCII.M|
|000000c0| 49 4d 45 2d 56 65 72 73 | 69 6f 6e 3a 20 31 2e 30 |IME-Vers|ion: 1.0|
|000000d0| 0a 58 2d 4e 65 77 73 72 | 65 61 64 65 72 3a 20 57 |.X-Newsr|eader: W|
|000000e0| 69 6e 56 4e 20 30 2e 39 | 39 2e 36 0a 52 65 70 6c |inVN 0.9|9.6.Repl|
|000000f0| 79 2d 54 6f 3a 20 68 6f | 64 67 65 73 40 69 64 69 |y-To: ho|dges@idi|
|00000100| 72 65 63 74 2e 63 6f 6d | 0a 58 2d 43 6c 69 65 6e |rect.com|.X-Clien|
|00000110| 74 2d 50 6f 72 74 3a 20 | 31 30 32 37 0a 4d 65 73 |t-Port: |1027.Mes|
|00000120| 73 61 67 65 2d 49 44 3a | 20 3c 72 61 67 6e 61 72 |sage-ID:| <ragnar|
|00000130| 6f 65 6b 31 39 39 36 46 | 65 62 32 32 2e 30 39 30 |oek1996F|eb22.090|
|00000140| 37 32 33 2e 32 30 34 34 | 38 40 6e 65 77 73 32 2e |723.2044|8@news2.|
|00000150| 63 6f 6d 70 75 6c 69 6e | 6b 2e 63 6f 6d 3e 0a 58 |compulin|k.com>.X|
|00000160| 2d 4e 6e 74 70 2d 50 6f | 73 74 69 6e 67 2d 48 6f |-Nntp-Po|sting-Ho|
|00000170| 73 74 3a 20 68 6f 70 65 | 2e 69 64 69 72 65 63 74 |st: hope|.idirect|
|00000180| 2e 63 6f 6d 0a 44 61 74 | 65 3a 20 32 32 20 46 65 |.com.Dat|e: 22 Fe|
|00000190| 62 20 39 36 20 31 34 3a | 30 37 3a 32 33 20 47 4d |b 96 14:|07:23 GM|
|000001a0| 54 0a 53 65 6e 64 65 72 | 3a 20 68 6f 64 67 65 73 |T.Sender|: hodges|
|000001b0| 40 68 6f 70 65 2e 69 64 | 69 72 65 63 74 2e 63 6f |@hope.id|irect.co|
|000001c0| 6d 0a 0a 49 20 61 6d 20 | 74 65 61 63 68 69 6e 67 |m..I am |teaching|
|000001d0| 20 6d 79 73 65 6c 66 20 | 27 43 27 20 61 6e 64 20 | myself |'C' and |
|000001e0| 49 20 68 61 76 65 20 61 | 20 70 72 6f 62 6c 65 6d |I have a| problem|
|000001f0| 20 77 69 74 68 20 75 6e | 64 65 72 73 74 61 6e 64 | with un|derstand|
|00000200| 69 6e 67 20 77 69 74 68 | 20 61 20 0a 73 70 65 63 |ing with| a .spec|
|00000210| 69 66 69 63 20 70 61 72 | 74 20 6f 66 20 73 6f 6d |ific par|t of som|
|00000220| 65 20 73 61 6d 70 6c 65 | 20 63 6f 64 65 20 77 68 |e sample| code wh|
|00000230| 69 63 68 20 61 70 70 65 | 61 72 65 64 20 69 6e 20 |ich appe|ared in |
|00000240| 61 20 4d 69 63 72 6f 73 | 6f 66 74 20 70 72 6f 67 |a Micros|oft prog|
|00000250| 72 61 6d 20 0a 62 6f 6f | 6b 2e 20 54 68 65 20 70 |ram .boo|k. The p|
|00000260| 72 6f 67 72 61 6d 20 69 | 73 20 61 73 20 66 6f 6c |rogram i|s as fol|
|00000270| 6c 6f 77 73 2e 0a 0a 23 | 69 6e 63 6c 75 64 65 20 |lows...#|include |
|00000280| 3c 73 74 64 69 6f 2e 68 | 3e 0a 23 69 6e 63 6c 75 |<stdio.h|>.#inclu|
|00000290| 64 65 20 3c 73 74 72 69 | 6e 67 2e 68 3e 0a 23 69 |de <stri|ng.h>.#i|
|000002a0| 6e 63 6c 75 64 65 20 3c | 66 63 6e 74 6c 2e 68 3e |nclude <|fcntl.h>|
|000002b0| 0a 23 69 6e 63 6c 75 64 | 65 20 3c 73 79 73 5c 74 |.#includ|e <sys\t|
|000002c0| 79 70 65 73 2e 68 3e 0a | 23 69 6e 63 6c 75 64 65 |ypes.h>.|#include|
|000002d0| 20 3c 73 79 73 5c 73 74 | 61 74 2e 68 3e 0a 23 69 | <sys\st|at.h>.#i|
|000002e0| 6e 63 6c 75 64 65 20 3c | 69 6f 2e 68 3e 0a 0a 23 |nclude <|io.h>..#|
|000002f0| 64 65 66 69 6e 65 20 42 | 55 46 46 20 35 31 32 0a |define B|UFF 512.|
|00000300| 0a 6d 61 69 6e 28 29 0a | 7b 0a 09 63 68 61 72 20 |.main().|{..char |
|00000310| 69 6e 62 75 66 66 65 72 | 5b 42 55 46 46 5d 3b 0a |inbuffer|[BUFF];.|
|00000320| 09 63 68 61 72 20 6f 75 | 74 62 75 66 66 65 72 5b |.char ou|tbuffer[|
|00000330| 42 55 46 46 5d 3b 0a 09 | 69 6e 74 20 69 6e 66 69 |BUFF];..|int infi|
|00000340| 6c 65 2c 20 6f 75 74 66 | 69 6c 65 2c 20 6c 65 6e |le, outf|ile, len|
|00000350| 67 74 68 2c 20 6e 75 6d | 3b 0a 0a 09 73 74 72 63 |gth, num|;...strc|
|00000360| 70 79 28 6f 75 74 62 75 | 66 66 65 72 2c 20 22 48 |py(outbu|ffer, "H|
|00000370| 61 70 70 79 20 42 69 72 | 74 68 64 61 79 2e 22 29 |appy Bir|thday.")|
|00000380| 3b 0a 09 6c 65 6e 67 74 | 68 20 3d 20 73 74 72 6c |;..lengt|h = strl|
|00000390| 65 6e 28 6f 75 74 62 75 | 66 66 65 72 29 3b 0a 09 |en(outbu|ffer);..|
|000003a0| 6c 65 6e 67 74 68 2b 2b | 3b 0a 0a 09 69 66 28 28 |length++|;...if((|
|000003b0| 6f 75 74 66 69 6c 65 20 | 3d 20 6f 70 65 6e 28 22 |outfile |= open("|
|000003c0| 74 65 73 74 66 69 6c 65 | 2e 62 69 6e 22 2c 0a 09 |testfile|.bin",..|
|000003d0| 20 20 20 4f 5f 43 52 45 | 41 54 20 7c 20 4f 5f 57 | O_CRE|AT | O_W|
|000003e0| 52 4f 4e 4c 59 20 7c 20 | 4f 5f 42 49 4e 41 52 59 |RONLY | |O_BINARY|
|000003f0| 2c 20 53 5f 49 57 52 49 | 54 45 29 29 20 21 3d 20 |, S_IWRI|TE)) != |
|00000400| 2d 31 29 09 09 0a 09 7b | 0a 09 09 69 66 28 28 6e |-1)....{|...if((n|
|00000410| 75 6d 20 3d 20 77 72 69 | 74 65 28 6f 75 74 66 69 |um = wri|te(outfi|
|00000420| 6c 65 2c 20 6f 75 74 62 | 75 66 66 65 72 2c 20 6c |le, outb|uffer, l|
|00000430| 65 6e 67 74 68 29 29 20 | 3d 3d 20 2d 31 29 0a 09 |ength)) |== -1)..|
|00000440| 09 09 70 65 72 72 6f 72 | 28 22 45 72 72 6f 72 20 |..perror|("Error |
|00000450| 69 6e 20 77 72 69 74 69 | 6e 67 22 29 3b 0a 09 09 |in writi|ng");...|
|00000460| 70 72 69 6e 74 66 28 22 | 5c 6e 42 79 74 65 73 20 |printf("|\nBytes |
|00000470| 77 72 69 74 74 65 6e 20 | 74 6f 20 66 69 6c 65 3a |written |to file:|
|00000480| 20 25 64 5c 6e 22 2c 20 | 6e 75 6d 29 3b 0a 09 09 | %d\n", |num);...|
|00000490| 63 6c 6f 73 65 28 6f 75 | 74 66 69 6c 65 29 3b 0a |close(ou|tfile);.|
|000004a0| 09 7d 0a 09 65 6c 73 65 | 0a 09 09 70 65 72 72 6f |.}..else|...perro|
|000004b0| 72 28 22 45 72 72 6f 72 | 20 6f 70 65 6e 69 6e 67 |r("Error| opening|
|000004c0| 20 6f 75 74 66 69 6c 65 | 22 29 3b 0a 7d 0a 0a 2f | outfile|");.}../|
|000004d0| 2a 20 54 68 65 72 65 20 | 69 73 20 6d 6f 72 65 20 |* There |is more |
|000004e0| 63 6f 64 65 20 61 66 74 | 65 72 20 74 68 69 73 20 |code aft|er this |
|000004f0| 62 75 74 20 69 73 20 6e | 6f 74 20 61 70 70 6c 69 |but is n|ot appli|
|00000500| 63 61 6c 62 65 20 74 6f | 20 6d 79 20 70 72 6f 62 |calbe to| my prob|
|00000510| 6c 65 6d 20 2a 2f 0a 0a | 4d 79 20 70 72 6f 62 6c |lem */..|My probl|
|00000520| 65 6d 20 69 73 20 61 73 | 20 66 6f 6c 6c 6f 77 73 |em is as| follows|
|00000530| 2e 2e 2e 2e 20 0a 0a 54 | 68 65 20 72 65 61 64 20 |.... ..T|he read |
|00000540| 61 6e 64 20 77 72 69 74 | 65 20 66 75 6e 63 74 69 |and writ|e functi|
|00000550| 6f 6e 73 20 6f 6e 6c 79 | 20 72 65 74 75 72 6e 20 |ons only| return |
|00000560| 74 68 65 20 6e 75 6d 62 | 65 72 20 6f 66 20 62 79 |the numb|er of by|
|00000570| 74 65 73 20 72 65 61 64 | 20 6f 72 20 0a 77 72 69 |tes read| or .wri|
|00000580| 74 74 65 6e 2e 20 53 6f | 20 77 68 79 20 69 73 20 |tten. So| why is |
|00000590| 69 74 20 6e 65 63 65 73 | 73 61 72 79 20 74 6f 20 |it neces|sary to |
|000005a0| 69 6e 63 72 65 6d 65 6e | 74 20 22 6c 65 6e 67 74 |incremen|t "lengt|
|000005b0| 68 2b 2b 22 20 61 66 74 | 65 72 20 75 73 69 6e 67 |h++" aft|er using|
|000005c0| 20 73 74 72 63 70 79 20 | 0a 66 75 6e 63 74 69 6f | strcpy |.functio|
|000005d0| 6e 20 74 6f 20 63 6f 70 | 79 20 22 48 61 70 70 79 |n to cop|y "Happy|
|000005e0| 20 42 69 72 74 68 64 61 | 79 2e 22 20 74 6f 20 6f | Birthda|y." to o|
|000005f0| 75 74 62 75 66 66 65 72 | 2e 20 42 79 20 64 6f 69 |utbuffer|. By doi|
|00000600| 6e 67 20 74 68 69 73 2c | 20 6c 65 6e 67 74 68 20 |ng this,| length |
|00000610| 0a 61 63 74 75 61 6c 6c | 79 20 72 65 74 75 72 6e |.actuall|y return|
|00000620| 73 20 74 68 65 20 62 79 | 74 65 20 73 69 7a 65 20 |s the by|te size |
|00000630| 69 6e 63 6c 75 64 69 6e | 67 20 74 68 65 20 4e 55 |includin|g the NU|
|00000640| 4c 4c 20 63 68 61 72 61 | 63 74 65 72 2e 20 3f 3f |LL chara|cter. ??|
|00000650| 3f 3f 3f 0a 0a 0a 51 75 | 65 73 74 69 6f 6e 20 23 |???...Qu|estion #|
|00000660| 20 32 3a 0a 0a 49 6e 20 | 73 74 61 6e 64 61 72 64 | 2:..In |standard|
|00000670| 20 49 2f 4f 2c 20 74 68 | 65 20 66 70 72 69 6e 74 | I/O, th|e fprint|
|00000680| 66 20 66 75 6e 63 74 69 | 6f 6e 20 63 61 6e 20 62 |f functi|on can b|
|00000690| 65 20 75 73 65 64 20 74 | 6f 20 77 72 69 74 65 20 |e used t|o write |
|000006a0| 66 6f 72 6d 61 74 74 65 | 64 20 6f 75 74 70 75 74 |formatte|d output|
|000006b0| 20 0a 74 6f 20 61 20 66 | 69 6c 65 20 61 73 73 6f | .to a f|ile asso|
|000006c0| 63 69 61 74 65 64 20 77 | 69 74 68 20 61 20 66 69 |ciated w|ith a fi|
|000006d0| 6c 65 20 70 6f 69 6e 74 | 65 72 2e 20 43 61 6e 20 |le point|er. Can |
|000006e0| 73 70 72 69 6e 74 66 20 | 62 65 20 75 73 65 64 20 |sprintf |be used |
|000006f0| 77 69 74 68 20 4c 6f 77 | 20 6c 65 76 65 6c 20 0a |with Low| level .|
|00000700| 49 2f 4f 20 74 6f 20 77 | 72 69 74 65 20 66 6f 72 |I/O to w|rite for|
|00000710| 6d 61 74 74 65 64 20 6f | 75 74 70 75 74 20 74 6f |matted o|utput to|
|00000720| 20 61 20 66 69 6c 65 20 | 61 73 73 6f 63 69 61 74 | a file |associat|
|00000730| 65 64 20 77 69 74 68 20 | 61 20 73 70 65 63 69 66 |ed with |a specif|
|00000740| 69 63 20 66 69 6c 65 20 | 0a 68 61 6e 64 6c 65 3f |ic file |.handle?|
|00000750| 20 49 66 20 6e 6f 74 20 | 68 6f 77 20 77 6f 75 6c | If not |how woul|
|00000760| 64 20 6f 6e 65 20 67 6f | 20 61 62 6f 75 74 20 77 |d one go| about w|
|00000770| 72 69 74 69 6e 67 20 74 | 6f 20 61 20 6c 6f 77 20 |riting t|o a low |
|00000780| 6c 65 76 65 6c 20 66 69 | 6c 65 20 77 68 69 63 68 |level fi|le which|
|00000790| 20 0a 77 6f 75 6c 64 20 | 61 63 68 69 65 76 65 20 | .would |achieve |
|000007a0| 74 68 65 20 73 61 6d 65 | 20 72 65 73 75 6c 74 73 |the same| results|
|000007b0| 20 61 73 20 66 70 72 69 | 6e 74 66 20 64 6f 65 73 | as fpri|ntf does|
|000007c0| 20 77 69 74 68 20 53 74 | 61 6e 64 61 72 64 20 49 | with St|andard I|
|000007d0| 2f 4f 3f 0a 0a 54 68 61 | 6e 6b 73 20 66 6f 72 20 |/O?..Tha|nks for |
|000007e0| 79 6f 75 72 20 68 65 6c | 70 2e 0a 0a 57 61 79 6e |your hel|p...Wayn|
|000007f0| 65 20 48 6f 64 67 65 73 | 0a 68 6f 64 67 65 73 40 |e Hodges|.hodges@|
|00000800| 69 64 69 72 65 63 74 2e | 63 6f 6d 0a 0a |idirect.|com.. |
+--------+-------------------------+-------------------------+--------+--------+